import { get, post } from './request.js'
import { Urls } from './urls.js'

export function createSession(jsCode) {
  const url = Urls.getApi("sessionCode");
  return get(url, {
    needAuth: false,
    data: {
      jsCode
    },
  })
}

export function saveUser(userInfo) {
  const url = Urls.getApi("saveUser");
  return post(url, {
    needAuth: true,
    data: { ...userInfo },
  })
}